package com.kevin.fileproviderserver;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.Toast;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}

	public void onShowList(View view) {
		Intent intent = new Intent();
		intent.setClass(getBaseContext(), FileSelectionActivity.class);
		startActivityForResult(intent, 0);
	}

	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		if (0 == requestCode) {
			if (RESULT_OK == resultCode) {
				String sFileName = data.getExtras().getString("FileName", "");
				Toast.makeText(MainActivity.this, sFileName, Toast.LENGTH_SHORT).show();
			}
		}
	}

}
